package com.shoping.common.response;

import lombok.Data;

@Data
public class ResponseData<T> {

    private Boolean success;

    private String code;

    private String message;

    private T data;

    public ResponseData() {
        super();
    }

    public ResponseData(T data) {
        this(true, "200", "request successfully", data);
    }

    public ResponseData(Boolean success, String code, String message) {
        this(success, code, message, null);
    }

    public ResponseData(Boolean success, String code, String message, T data) {
        this.success = success;
        this.code = code;
        this.message = message;
        this.data = data;
    }

    public static ResponseData build(Object data) {
        return new ResponseData(data);
    }
}
